package 分类.二分;

public class 判断子序列 {
    public boolean isSubsequence(String s, String t) {
        int i=0,j=0;
        while (i<s.length()&&j<t.length()){
            if(s.charAt(i)==t.charAt(j)){
                i++;
                j++;
            }else {
                j++;
            }
        }
        return i==s.length();
    }
}
